package com.heima.search.repository;

import com.heima.search.entity.ApAssociateWords;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * 操作联想词集合持久层
 */
public interface AssociateWordsRepository extends MongoRepository<ApAssociateWords, String> {

    /**
     * 根据传入关键字 查询五条 联想词
     */
    List<ApAssociateWords> findTop5ByAssociateWordsContainingOrderByCreatedTimeDesc(String key);


}
